package com.xinhe.cn.cpbox.payutils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class WXPayParms {
    public static String PUBLIC_APPID;    // 公众号appid

    public static String PUBLC_SECRET;    // 公众号secret

    public static String MCHID; // 商户号

    public static String PATERNER_KEY;    // 微信交易支付密钥

    public static String NOTIFY_URL;   // 腾讯支付结果通知路径，为前缀+/pay/callback接口

    @Value("${wx.params.PUBLIC_APPID}")
    public void setPublicAppid(String publicAppid) {
        PUBLIC_APPID = publicAppid;
    }

    @Value("${wx.params.PUBLC_SECRET}")
    public void setPublcSecret(String publcSecret) {
        PUBLC_SECRET = publcSecret;
    }

    @Value("${wx.params.MCHID}")
    public void setMCHID(String MCHID) {
        WXPayParms.MCHID = MCHID;
    }

    @Value("${wx.params.PATERNER_KEY}")
    public void setPaternerKey(String paternerKey) {
        PATERNER_KEY = paternerKey;
    }

    @Value("${constant.ACCESS_PREFIX}/pay/callback")
    public void setNotifyUrl(String notifyUrl) {
        NOTIFY_URL = notifyUrl;
    }
}

